package com.lkl.controller;

import com.lkl.entity.Course;
import com.lkl.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: Li
 * @Date: 2024/11/12 20:57
 * @Description:
 */

@RestController
public class CourseController {
    @Autowired
    private CourseService courseService;
    
    @GetMapping("findById")
    public Course findById(int id) {
        Course course = courseService.findById(id);
        return course;
    }
    
    @PostMapping("updateById")
    public String updateById(@RequestBody Course course) {
        String result = courseService.updateById(course);
        return result;
    }
}
